package com.design.原型模式;

import java.util.Date;

/**
 * 必须实现Cloneable接口
 * @author yuxuan
 *
 */
public class Person implements Cloneable {

	private String username;
	private Date createTime;
	
	
	public Person() {}
	
	public Date getCreateTime() {
		return createTime;
	}



	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}



	public Person(String username,Date createTime) {
		this.username = username;
		this.createTime = createTime;
	}
	
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}



	@Override
	protected Person clone()  {
		try {
			return (Person) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
			return null;
		}
	}
	
}
